import request from "../../utils/request.js";

// 获取用户自己信息
export const getUserInfoService = () => {
    return request.get('/userStock/getUserInfo');
}

//用户收藏股票
export const userStarStock = (stockSymbol) => {
    return request.post('/userStock/starStock', null, {
        params: { stockSymbol }
    })
}

//返回用户收藏所有股票
export const getUserStarStocks=()=>{
    return request.get('/userStock/getStarStock')
}

//查看用户是否收藏过次股票
export const isUserStarThisStock=(stockSymbol)=>{
    return request.get('/userStock/isStarThisStock', {
        params: {
            stockSymbol: stockSymbol
        }
    })
}

//根据股票名称返回order数据
export const getUserOrderByStockSymbol=(stockSymbol)=>{
    return request.get('/userStock/getUserOrderBySymbol', {
        params: {
            stockSymbol: stockSymbol
        }
    })
}

//返回用户的股票总和
export const getUserStockSummary=()=>{
    return request.get('/userStock/getUserStockSummary'
    )
}
//用户查看自己购买股票信息
export const getUserBuyStock=()=>{
    return request.get('/userStock/getBuyStock'
    )
}
//用户查看自己卖出股票信息
export const getUserSellStocky=()=>{
    return request.get('/userStock/getSellStock'
    )
}
//返回总订单信息
export const getUserOrder=()=>{
    return request.get('/userStock/getUserOrder'
    )
}